package com.solotiger.geographic.biz.api;

import com.solotiger.geographic.biz.api.base.BaseApi;
import com.solotiger.geographic.biz.model.AlbumResult;
import com.solotiger.geographic.biz.model.PictureResult;
import com.solotiger.geographic.biz.network.INetwork;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
 * 对外的统一接口
 */
public class NetWorkApi extends BaseApi {

    protected static final INetwork network = getRetrofit().create(INetwork.class);

    /**
     * @param page
     * @return
     */
    public static Observable<AlbumResult> getAlbums(int page) {
        //其它业务逻辑
        return network.getAlbums(page);
    }

    /**
     * @param albumId
     * @return
     */
    public static Observable<PictureResult> getPictureByAlbumId(String albumId) {
        //其它业务逻辑
        return network.getPictureByAlbumId(albumId);
    }

    /**
     * 下载
     *
     * @param url
     * @return
     */
    public static Observable<ResponseBody> downloadPic(String url) {
        return network.downloadPic(url);
    }


}
